#!/bin/bash
OldBackupSize=`cat /BackupSize`
NewBackupSize=`du -sh /home/htzy/zhao/ | awk -F " " '{print$1}'`

if [ $OldBackupSize = $NewBackupSize ]
then
        echo -e `date`_"没有备份\n" >> /BackupLog
else
        echo -e `date`_"已经备份\n" >> /BackupLog
        #发送邮件
        echo -e "原大小："$OldBackupSize"\n现大小："$NewBackupSize"" | mail -s "FTPBackup" 1218304973@qq.com
        du -sh /home/htzy/zhao/ | awk -F " " '{print$1}' > /BackupSize
fi